package com.qf.ssm.mapper;

import com.qf.ssm.pojo.TbGoodsType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

public interface GoodsTypeMapper {
    @Select("select * from tb_goods_type where id=#{id}")
    TbGoodsType findById(Long id);
    @Insert("insert into tb_goods_type (name,level,Parent) values(#{name},#{level},#{Parent})")
    void addGoodsType(TbGoodsType goodsType);
    @Select("select * from tb_goods_type ")
    List<TbGoodsType> findAll();
    @Delete("DELETE FROM tb_goods_type WHERE id=#{id}")
    int deleteById(Long id);
}
